package com.qf.boot.service.consumer;

import com.qf.boot.service.api.SiteService;
import com.qf.boot.service.api.SiteServiceListenerImpl;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;

@EnableAutoConfiguration
public class CallbackDubboConsumer {

    @Reference(version = "callback")
    private SiteService siteService;

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(CallbackDubboConsumer.class);
        SiteService service = context.getBean(SiteService.class);
        System.out.println(service.siteName("n-face","c1",new SiteServiceListenerImpl()));
//        System.out.println(service.siteName("n-face","c2",new SiteServiceListenerImpl()));
//        System.out.println(service.siteName("n-face","c3",new SiteServiceListenerImpl()));
    }

}
